home *** CD-ROM | disk | FTP | other *** search
- Path: news1.intercall.com!usenet
- From: engevar@intercall.com (Steven Ovits)
- Newsgroups: comp.lang.c++
- Subject: Re: Copy constructor
- Date: Mon, 15 Apr 1996 12:33:31 GMT
- Organization: Intercall Inc.
- Message-ID: <4kt6b9$9a4@news1.intercall.com>
- References: <4kjudi$2qj0@holly.ACNS.ColoState.EDU> <316EE05E.72F7@braunschweig.netsurf.de>
- NNTP-Posting-Host: 206.98.168.162
- X-Newsreader: Forte Free Agent 1.0.82
-
- Corby S. Hudnall wrote:
- > Hi all, I'm having some trouble figuring out how to do a copy
- > constructor. Here's what I thought was suppose to work:
- [stuff deleted]
- > ABC::ABC(const ABC& NewABC)
- > {
- > this->AnInt = NewABC->AnInt;
- > }
-
- You need to use the dot operator on a reference.
- Use AnInt = NewABC.AnInt;
- or this->AnInt = NewABC.AnInt;
-
-
-